Fixed Attribute Implementation

Fixed attribute implementation when different img formats are used.