from django.core.files.images import get_image_dimensions

media_img = self.cleaned_data.get('img')

img_width, img_height = get_image_dimensions(media_img)