Cleaning up

Once you've finished using the image library, you should clean up by unlocking the hardware, and freeing the part of the image structure that you're responsible for. For example: