Image size function to prevent mistakes