bugfix and picture resize if needed