You should test if the attachment_type starts with image, unless you really want to only target png.