added dynamic image count

also switched back to jpg