check image type when saving gallery