support JPG file using gd library
bug fix when reading extension ( "png" -> ".png", "jpg" -> ".jpg")