fixed a bug in prettyfig which caused an error with images