Could you help me finding a mistake in this code. It produces .jpg files, but all of them have the same size and no content (white, empty, nothing). What I did wrong?