Added function to trim atlas image size