Fix for interlaced and small images + cleanup