Better input file format detection with getimagesize, added sizeup and background color parameters