Update res3izer.py

Added image format detection using base module imghdr, as fileext detection was causing problems for me.